Skip to content

fix: separate Compactions and ContextBombsDelivered counters in buildReportData#435

Merged
claude[bot] merged 1 commit intomainfrom
claude/issue-432-20260301-2015
Mar 1, 2026
Merged

fix: separate Compactions and ContextBombsDelivered counters in buildReportData#435
claude[bot] merged 1 commit intomainfrom
claude/issue-432-20260301-2015

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Mar 1, 2026

Summary

  • Compactions now counts only EventRun entries where SessionSnapshotPresent == true (genuine compaction events where the PreCompact hook ran successfully)
  • ContextBombsDelivered counts all EventRun entries regardless of snapshot presence
  • Adds backward-compatibility for entries with an empty EventType field, treating them as EventRun (matching the same logic already present in activitylog.ReadAll)

Changes

cmd/report.go - buildReportData:

  1. Added eventType local variable with empty-string -> EventRun fallback before the EventType filter
  2. Changed Compactions: runCount -> Compactions: snapshots (the snapshots counter already correctly tracks SessionSnapshotPresent == true entries)

Test

The existing TestBuildReportData_CompactionCount test at cmd/report_test.go:178 documents and verifies this exact distinction. With this fix, that test passes along with the other buildReportData tests that use entries without EventType set (now handled by the backward-compat path).

Fixes #432

Generated with Claude Code

…ReportData

Compactions now counts only EventRun entries where SessionSnapshotPresent is
true (genuine compaction events where the PreCompact hook ran). ContextBombsDelivered
counts all EventRun entries regardless of snapshot presence.

Also adds backward-compatibility handling for entries with an empty EventType
field, treating them as EventRun (same logic already present in ReadAll).

Fixes #432

Co-Authored-By: Grey Newell <greyshipscode@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude claude bot merged commit 12b15e8 into main Mar 1, 2026
1 check passed
@claude claude bot deleted the claude/issue-432-20260301-2015 branch March 1, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Compactions and ContextBombsDelivered are always equal in buildReportData, contradicting test spec

0 participants